specificity %in% c(1, 2, 3),
!(targtype1 %in% c(2, 3, 4, 5, 7, 10, 11, 12, 17, 20, 22)),
!(attacktype1 %in% c(1, 7, 8, 9)))
nrow(gtd_nga_narrow) #1136
gtd_nga_narrow_paper <- gtd_nga %>%
dplyr::filter(doubtterr == 0,
specificity %in% c(1, 2, 3),
!(targtype1 %in% c(2, 3, 4, 7)),
!(attacktype1 %in% c(1)))
nrow(gtd_nga_narrow) #1136
gtd_nga_narrow <- gtd_nga %>%
dplyr::filter(doubtterr == 0,
specificity %in% c(1, 2, 3),
!(targtype1 %in% c(2, 3, 4, 5, 7, 10, 11, 12, 17, 20, 22)),
!(attacktype1 %in% c(1, 7, 8, 9)))
nrow(gtd_nga_narrow) #1136
# This is the version of the data that was submitted first to JPR
gtd_nga_wide <- gtd_nga %>%
dplyr::filter(doubtterr == 0,
specificity %in% c(1, 2, 3),
targtype1 != 4)
nrow(gtd_nga_wide) #1779
gtd_nga_narrow <- gtd_nga %>%
dplyr::filter(doubtterr == 0,
specificity %in% c(1, 2, 3),
!(targtype1 %in% c(2, 3, 4, 5, 7, 10, 11, 12, 17, 20, 22)),
!(attacktype1 %in% c(1, 7, 8, 9)))
nrow(gtd_nga_narrow) #1136
gtd_nga_narrow_paper <- gtd_nga %>%
dplyr::filter(doubtterr == 0,
specificity %in% c(1, 2, 3),
!(targtype1 %in% c(2, 3, 4, 7)),
!(attacktype1 %in% c(1)))
nrow(gtd_nga_narrow) #1136
gtd_nga <- gtd_og %>%
filter(
iyear >= 2008,
iyear <= 2017,
country_txt == "Nigeria",
gname %in% c("Boko Haram",
"Al-Qaida in the Islamic Maghreb (AQIM)"),
!is.na(date)
)
nrow(gtd_nga) #2084 events
table(gtd_nga$doubtterr) #194 excluded
# This is the version of the data that was submitted first to JPR
gtd_nga_wide <- gtd_nga %>%
dplyr::filter(doubtterr == 0,
specificity %in% c(1, 2, 3),
targtype1 != 4)
(gtd_nga$targtype1_txt)
table(gtd_nga$targtype1_txt)
table(gtd_nga$attacktype1_txt)
gtd_nga_narrow <- gtd_nga %>%
dplyr::filter(doubtterr == 0,
specificity %in% c(1, 2, 3),
!(targtype1 %in% c(2, 3, 4, 5, 7, 10, 11, 12, 17, 20, 22)),
!(attacktype1 %in% c(1, 7, 8, 9)))
nrow(gtd_nga_narrow) #1136
nrow(gtd_nga_narrow_paper) #1136
nrow(gtd_nga_narrow_paper) - nrow(gtd_nga_narrow)
# Getting geographic data
set.seed(12345)
nga <- getData('GADM', country = 'NGA', level = 2)
crs <- proj4string(nga)
states <- c(
"Adamawa",
"Bauchi",
"Benue",
"Borno",
"Gombe",
"Jigawa",
"Kaduna",
"Kano",
"Katsina",
"Nassarawa",
"Niger",
"Plateau",
"Taraba",
"Yobe",
"Federal Capital Territory"
)
nganorth <- nga[nga$NAME_1 %in% states, ]
nganorth_sf <- nganorth %>%
st_as_sf()
gtd_nga_sf <- gtd_nga_narrow %>%
st_as_sf(coords = c("longitude", "latitude"),
crs = crs)
cols_gtd_nga <- names(gtd_nga_narrow)
gtd_nga_sf_filter <- gtd_nga_sf %>%
st_intersection(nganorth_sf) %>%
dplyr::select(one_of(cols_gtd_nga)) %>%
mutate(longitude = unlist(map(.$geometry, 1)),
latitude = unlist(map(.$geometry, 2)))
nrow(gtd_nga_sf_filter)
## Prepping GED data
ged_nga <- ged_og %>%
filter(
type_of_violence == 1,
#state-based conflict. In state- based armed conflicts, at least one of the primary parties must be the government of a state.
where_prec %in% c(1, 2, 3),
year >= 2008,
year <= 2017,
country == "Nigeria",
side_b %in% c("Jama'atu Ahlis Sunna Lidda'awati wal-Jihad",
"IS")
) %>%
mutate(date_start = ymd(date_start),
date_end = ymd(date_end)) %>%
mutate(date = as.Date(date_start),
enddate = as.Date(date_end),
event_tax = type_of_violence,
actor_tax = side_b,
prec_tax = where_prec,
descr = source_headline,
descr_add = source_article)
ged_nga_sf <- ged_nga %>%
st_as_sf(coords = c("longitude", "latitude"),
crs = crs)
cols_ged_nga <- names(ged_nga)
ged_nga_sf_filter <- ged_nga_sf %>%
st_intersection(nganorth_sf) %>%
dplyr::select(one_of(cols_ged_nga)) %>%
mutate(longitude = unlist(map(.$geometry, 1)),
latitude = unlist(map(.$geometry, 2))) #1086
ged <- ged_nga_sf_filter
gtd <- gtd_nga_sf_filter
gtd_nga_sf <- gtd_nga_wide %>%
st_as_sf(coords = c("longitude", "latitude"),
crs = crs)
cols_gtd_nga <- names(gtd_nga_narrow)
gtd_nga_sf_filter <- gtd_nga_sf %>%
st_intersection(nganorth_sf) %>%
dplyr::select(one_of(cols_gtd_nga)) %>%
mutate(longitude = unlist(map(.$geometry, 1)),
latitude = unlist(map(.$geometry, 2)))
nrow(gtd_nga_sf_filter)
## Prepping GED data
ged_nga <- ged_og %>%
filter(
type_of_violence == 1,
#state-based conflict. In state- based armed conflicts, at least one of the primary parties must be the government of a state.
where_prec %in% c(1, 2, 3),
year >= 2008,
year <= 2017,
country == "Nigeria",
side_b %in% c("Jama'atu Ahlis Sunna Lidda'awati wal-Jihad",
"IS")
) %>%
mutate(date_start = ymd(date_start),
date_end = ymd(date_end)) %>%
mutate(date = as.Date(date_start),
enddate = as.Date(date_end),
event_tax = type_of_violence,
actor_tax = side_b,
prec_tax = where_prec,
descr = source_headline,
descr_add = source_article)
ged_nga_sf <- ged_nga %>%
st_as_sf(coords = c("longitude", "latitude"),
crs = crs)
cols_ged_nga <- names(ged_nga)
ged_nga_sf_filter <- ged_nga_sf %>%
st_intersection(nganorth_sf) %>%
dplyr::select(one_of(cols_ged_nga)) %>%
mutate(longitude = unlist(map(.$geometry, 1)),
latitude = unlist(map(.$geometry, 2))) #1086
ged <- ged_nga_sf_filter
gtd <- gtd_nga_sf_filter
##### Running NGA ######
output = meltt(gtd, ged,
taxonomies = taxonomy_nga,
twindow = 1,
spatwindow = 3)
summary(output) #220 potential duplicates if military targets excluded; 148 if "official targets excluded", 128 if fortna et al less restrictive measure is used
gtd_nga_sf <- gtd_nga_narrow %>%
st_as_sf(coords = c("longitude", "latitude"),
crs = crs)
cols_gtd_nga <- names(gtd_nga_narrow)
gtd_nga_sf_filter <- gtd_nga_sf %>%
st_intersection(nganorth_sf) %>%
dplyr::select(one_of(cols_gtd_nga)) %>%
mutate(longitude = unlist(map(.$geometry, 1)),
latitude = unlist(map(.$geometry, 2)))
nrow(gtd_nga_sf_filter)
## Prepping GED data
ged_nga <- ged_og %>%
filter(
type_of_violence == 1,
#state-based conflict. In state- based armed conflicts, at least one of the primary parties must be the government of a state.
where_prec %in% c(1, 2, 3),
year >= 2008,
year <= 2017,
country == "Nigeria",
side_b %in% c("Jama'atu Ahlis Sunna Lidda'awati wal-Jihad",
"IS")
) %>%
mutate(date_start = ymd(date_start),
date_end = ymd(date_end)) %>%
mutate(date = as.Date(date_start),
enddate = as.Date(date_end),
event_tax = type_of_violence,
actor_tax = side_b,
prec_tax = where_prec,
descr = source_headline,
descr_add = source_article)
ged_nga_sf <- ged_nga %>%
st_as_sf(coords = c("longitude", "latitude"),
crs = crs)
cols_ged_nga <- names(ged_nga)
ged_nga_sf_filter <- ged_nga_sf %>%
st_intersection(nganorth_sf) %>%
dplyr::select(one_of(cols_ged_nga)) %>%
mutate(longitude = unlist(map(.$geometry, 1)),
latitude = unlist(map(.$geometry, 2))) #1086
ged <- ged_nga_sf_filter
gtd <- gtd_nga_sf_filter
##### Running NGA ######
output = meltt(gtd, ged,
taxonomies = taxonomy_nga,
twindow = 1,
spatwindow = 3)
summary(output) #220 potential duplicates if military targets excluded; 148 if "official targets excluded", 128 if fortna et al less restrictive measure is used
gtd_nga_narrow_paper <- gtd_nga %>%
dplyr::filter(doubtterr == 0,
specificity %in% c(1, 2, 3),
!(targtype1 %in% c(2, 3, 4, 7)),
!(attacktype1 %in% c(1)))
gtd_nga_sf <- gtd_nga_narrow_paper %>%
st_as_sf(coords = c("longitude", "latitude"),
crs = crs)
cols_gtd_nga <- names(gtd_nga_narrow)
gtd_nga_sf_filter <- gtd_nga_sf %>%
st_intersection(nganorth_sf) %>%
dplyr::select(one_of(cols_gtd_nga)) %>%
mutate(longitude = unlist(map(.$geometry, 1)),
latitude = unlist(map(.$geometry, 2)))
nrow(gtd_nga_sf_filter)
## Prepping GED data
ged_nga <- ged_og %>%
filter(
type_of_violence == 1,
#state-based conflict. In state- based armed conflicts, at least one of the primary parties must be the government of a state.
where_prec %in% c(1, 2, 3),
year >= 2008,
year <= 2017,
country == "Nigeria",
side_b %in% c("Jama'atu Ahlis Sunna Lidda'awati wal-Jihad",
"IS")
) %>%
mutate(date_start = ymd(date_start),
date_end = ymd(date_end)) %>%
mutate(date = as.Date(date_start),
enddate = as.Date(date_end),
event_tax = type_of_violence,
actor_tax = side_b,
prec_tax = where_prec,
descr = source_headline,
descr_add = source_article)
ged_nga_sf <- ged_nga %>%
st_as_sf(coords = c("longitude", "latitude"),
crs = crs)
cols_ged_nga <- names(ged_nga)
ged_nga_sf_filter <- ged_nga_sf %>%
st_intersection(nganorth_sf) %>%
dplyr::select(one_of(cols_ged_nga)) %>%
mutate(longitude = unlist(map(.$geometry, 1)),
latitude = unlist(map(.$geometry, 2))) #1086
ged <- ged_nga_sf_filter
gtd <- gtd_nga_sf_filter
##### Running NGA ######
output = meltt(gtd, ged,
taxonomies = taxonomy_nga,
twindow = 1,
spatwindow = 3)
summary(output) #220 potential duplicates if military targets excluded; 148 if "official targets excluded", 128 if fortna et al less restrictive measure is used
duplicate_entries = meltt_duplicates(output,columns=c("date","longitude","latitude","descr", "descr_add", "nkill", "best")) %>%
mutate(id=row_number())
nrow(duplicate_entries) #220, 148 if official targets removed in GTD, 128 using Fortna measure
View(duplicate_entries)
## change 19/12/05: add the ~20 observations
# which extra coded as dupes?
dupes_noofficial <- duplicate_entries$gtd_eventID
dupes_noofficial
out <- gtd_nga_sf_filter[dupes_noofficial,]
View(out)
dupes_fortna <- read_excel("./Analysis/tc_hmm_decay_191125/tc_jpr_191014/duplicate_nga_gtdlead_fortnaetal2018_191103.xlsx")
### Manually coded potential duplicates
library(readxl)
library(readxl)
dupes_fortna <- read_excel("./Analysis/tc_hmm_decay_191125/tc_jpr_191014/duplicate_nga_gtdlead_fortnaetal2018_191103.xlsx")
dupes_fortna <- read_excel("./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_fortnaetal2018_191103.xlsx")
View(dupes_fortna)
## change 19/12/05: add the ~20 observations
# which extra coded as dupes?
dupe_id_noofficial <- duplicate_entries$gtd_eventID
out <- gtd_nga_sf_filter[dupe_id_noofficial,]
dupe_id_fortna <- dupes_fortna$gtd_eventID
!(dupe_id_noofficial %in% dupe_id_fortna)
dupe_id_noofficial[!(dupe_id_noofficial %in% dupe_id_fortna)]
dupe_id_noofficial[(dupe_id_noofficial %in% dupe_id_fortna)]
diff <- dupe_id_noofficial[(dupe_id_noofficial %in% dupe_id_fortna)]
duplicate_entries_noofficial_extra <- meltt_duplicates(output,columns=c("date","longitude","latitude","descr", "descr_add", "nkill", "best")) %>%
mutate(id=row_number())
View(duplicate_entries_noofficial_extra)
duplicate_entries_noofficial_extra <- meltt_duplicates(output,columns=c("date","longitude","latitude","descr", "descr_add", "nkill", "best")) %>%
mutate(id=row_number()) %>%
filter(gtd_eventID %in% diff)
View(duplicate_entries_noofficial_extra)
duplicate_entries_noofficial_extra <- meltt_duplicates(output,columns=c("date","longitude","latitude","descr", "descr_add", "nkill", "best")) %>%
filter(gtd_eventID %in% diff)
write.csv(duplicate_entries,
"./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_extra_191205.csv",
row.names = F)
write.csv(duplicate_entries_noofficial_extra,
"./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_extra_191205.csv",
row.names = F)
## change 19/12/05: add the ~20 observations
# which extra coded as dupes?
dupe_id_noofficial <- duplicate_entries$gtd_eventID
out <- gtd_nga_sf_filter[dupe_id_noofficial,]
dupes_fortna <- read_excel("./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_fortnaetal2018_191103.xlsx")
## change 19/12/05: add the ~20 observations
# which extra coded as dupes?
dupe_id_noofficial <- duplicate_entries$gtd_eventID
dupes_fortna <- read_excel("./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_fortnaetal2018_191103.xlsx")
dupe_id_fortna <- dupes_fortna$gtd_eventID
dupes_fortna <- read_excel("./Analysis/tc_hmm_decay_191011/tc_jpr_191014/duplicate_nga_gtdlead_fortnaetal2018_191103.xlsx")
dupe_id_fortna <- dupes_fortna$gtd_eventID
dupe_id_fortna
gtd_id_fortna <- gtd_nga_narrow[dupe_id_fortna,]
dupe_id_noofficial <- duplicate_entries$gtd_eventID
gtd_id_noofficial <- gtd_nga_narrow_paper[dupe_id_noofficial,]
nrow(gtd_id_noofficial)
nrow(gtd_id_fortna)
View(gtd_id_noofficial)
gtd_id_noofficial <- gtd_nga_narrow_paper[dupe_id_noofficial,"eventid"]
gtd_id_noofficial
gtd_id_fortna <- gtd_nga_narrow[dupe_id_fortna,"eventid"]
nrow(gtd_id_fortna)
(gtd_id_noofficial %in% gtd_id_fortna)
diff <- gtd_id_noofficial[(gtd_id_noofficial %in% gtd_id_fortna)]
diff
which(gtd_nga_narrow_paper$eventid == diff)
which(gtd_nga_narrow_paper$eventid %in% diff)
rows <- which(gtd_nga_narrow_paper$eventid %in% diff)
rows %in% dupe_id_noofficial
diff
diff_rows <- which(gtd_nga_narrow_paper$eventid %in% diff)
diffduplicate_entries_noofficial_extra <- meltt_duplicates(output,columns=c("date","longitude","latitude","descr", "descr_add", "nkill", "best")) %>%
filter(gtd_eventID %in% diff_rows)
View(diffduplicate_entries_noofficial_extra)
write.csv(duplicate_entries_noofficial_extra,
"./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_extra_191205.csv",
row.names = F)
length(diff_rows)
nrow(diffduplicate_entries_noofficial_extra)
diffduplicate_entries_noofficial_extra <- meltt_duplicates(output,columns=c("date","longitude","latitude","descr", "descr_add", "nkill", "best")) %>%
filter(gtd_eventID %in% diff_rows)
nrow(diffduplicate_entries_noofficial_extra)
nrow(diffduplicate_entries_noofficial_extra)
write.csv(duplicate_entries_noofficial_extra,
"./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_extra_191205.csv",
row.names = F)
write.xlsx(duplicate_entries_noofficial_extra,
"./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_extra_191205.csv", sheetName = "Sheet1",
col.names = TRUE, row.names = FALSE, append = FALSE)
library(xlsc)
library(xlsx)
write.xlsx(duplicate_entries_noofficial_extra,
"./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_extra_191205.csv", sheetName = "Sheet1",
col.names = TRUE, row.names = FALSE, append = FALSE)
install.packages("openxlsx", lib="/Library/Frameworks/R.framework/Versions/3.6/Resources/library")
openxlsx::write.xlsx(duplicate_entries_noofficial_extra,
"./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_extra_191205.xlsx")
nrow(diffduplicate_entries_noofficial_extra)
openxlsx::write.xlsx(diffduplicate_entries_noofficial_extra,
"./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_extra_191205.xlsx")
View(diffduplicate_entries_noofficial_extra)
### Manually coded potential duplicates
library(readxl)
dupes <- read_excel("./Analysis/tc_hmm_decay_191011/tc_jpr_191014/duplicate_nga_gtdlead_noofficial_191105.xlsx")
dupes <- read_excel("./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_191105.xlsx")
dupes <- read_excel("./Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_noofficial_191105.xlsx")
dupes <- read_excel("~/Dropbox/Dissertation/TerritorialControl/Analysis/tc_hmm_decay_191011/tc_jpr_191125/duplicate_nga_gtdlead_nooffical_191205.xlsx")
table(dupes$designation)
## change 19/12/05: add the ~20 observations
# which extra coded as dupes?
dupes_fortna <- read_excel("./Analysis/tc_hmm_decay_191011/tc_jpr_191014/duplicate_nga_gtdlead_fortnaetal2018_191103.xlsx")
## change 19/12/05: add the ~20 observations
# which extra coded as dupes?
dupes_fortna <- read_excel("./Analysis/tc_hmm_decay_191011/tc_jpr_191014/duplicate_nga_gtdlead_fortnaetal2018_191103.xlsx")
dupe_id_fortna <- dupes_fortna$gtd_eventID
dupe_id_fortna
gtd_id_fortna <- gtd_nga_narrow[dupe_id_fortna,"eventid"]
dupe_id_noofficial <- duplicate_entries$gtd_eventID
gtd_id_noofficial <- gtd_nga_narrow_paper[dupe_id_noofficial,"eventid"]
diff <- gtd_id_noofficial[(gtd_id_noofficial %in% gtd_id_fortna)]
diff
diff <- gtd_id_noofficial[!(gtd_id_noofficial %in% gtd_id_fortna)]
diff
gtd_id_noofficial
gtd_id_fortna
diff <- all.equal(gtd_id_fortna, gtd_id_noofficial)
diff
gtd_id_fortna[gtd_id_fortna %in%gtd_id_noofficial]
gtd_id_noofficial[gtd_id_fortna %in%gtd_id_noofficial]
(nrow(gtd_nga_narrow) - nrow(gtd_nga_narrow_paper))/nrow(gtd_nga_narrow_paper)
df_dyadic <- readRDS("./data/master_dyadratio.rds")
#setwd("~replication files")
setwd("~/Dropbox/GeopoliticalCompetitionPaper2/Manuscript/ISQ_submission_Jan2019/final_nov2019/replication")
df_dyadic <- readRDS("./data/master_dyadratio.rds")
rm(list = ls())
library(countrycode)
library(tidyverse)
library(ggpubr)
library(gridExtra)
library(ggrepel)
library(Hmisc)
library(corrplot)
library(RColorBrewer)
library(colorspace)
library(maptools)
library(rgeos)
library(ggforce)
#setwd("~replication files")
setwd("~/Dropbox/GeopoliticalCompetitionPaper2/Manuscript/ISQ_submission_Jan2019/final_nov2019/replication")
# you can choose to load all neccesary data files using this load statement (which takes a while),
# or individually load data files as needed, using the provided readRDS() statements
load("./data/sdp_master.RData")
master <- readRDS("./data/master_geopolcompetition2_191101.rds")
df_dyadic <- readRDS("./data/master_dyadratio.rds")
us_sub <- df_dyadic %>%
filter(ccode == 2) %>%
dplyr::select(ccode, year, opponent,
boix_distinterestweight_dyadratio_gdp_invlog,
boix_distinterestweight_dyadratio_sdp1095_invlog,
polity_distinterestweight_dyadratio_gdp_invlog,
polity_distinterestweight_dyadratio_sdp1095_invlog) %>%
mutate(new_gdp = ifelse(is.na(polity_distinterestweight_dyadratio_gdp_invlog), boix_distinterestweight_dyadratio_gdp_invlog, polity_distinterestweight_dyadratio_gdp_invlog),
new_sdp1095 = ifelse(is.na(polity_distinterestweight_dyadratio_sdp1095_invlog), boix_distinterestweight_dyadratio_sdp1095_invlog, polity_distinterestweight_dyadratio_sdp1095_invlog)) %>%
dplyr::select(ccode, year, opponent, new_gdp, new_sdp1095) %>%
gather(indicator, value, -ccode, -year, -opponent) %>%
mutate(color = ifelse(opponent == 710, "China", "Total"),
color = replace(color, opponent == 365, "Russia")) %>%
filter(!is.na(value)) %>%
group_by(ccode, year, indicator, color) %>%
summarise(value = sum(value))
us_sub$color <- factor(us_sub$color,
levels = rev(c("China", "Russia", "Total")))
table(us_sub$indicator)
us_sub$indicator <- factor(us_sub$indicator,
levels = c("new_gdp",
"new_sdp1095"),
labels = c("GDP",
"SDP ($3 subsistence)"))
ggplot(us_sub,
aes(x = year,
y = value,
fill = factor(color),
color = factor(color))) +
geom_bar(stat = "identity", position = "stack", color = "white", size = 0.0001) +
scale_fill_manual(values = c("Total" = "grey85",
"China" = "#e66101",
"Russia" = "#5e3c99"),
name = "") +
scale_color_manual(values = c("Total" = "grey85",
"China" = "#e66101",
"Russia" = "#5e3c99"),
name = "") +
facet_wrap(~indicator) +
theme_bw() +
scale_x_continuous(breaks = seq(1800, 2000, 25)) +
labs(title = "Potential threat faced by the United States",
y = "Potential threat (Polity)",
x = "") +
theme(panel.grid.minor = element_blank(),
legend.position = "top",
strip.text = element_text(size = 6),
plot.title = element_text(size = 9, margin = margin(0,0,0,0)),
legend.text = element_text(size = 7),
legend.margin=margin(3,0,0,0),
axis.text = element_text(size = 6),
axis.title = element_text(size = 8)) +
guides(color = guide_legend(override.aes = list(size = 2)))
ggsave("figure5.eps", width = 6.5, height = 3.25, dpi = 500)
#### Reading models without subsistence controls
econ_surplus1095_alt <- readRDS("surplus1095coefs_surplus1095_invlog_fecy_alt.rds") %>%
mutate(controls = str_replace_all(controls, "surpl5", "surplus1095")) %>%
mutate(coef = "econ",
type_control = "wosub")
#### Reading models without subsistence controls
econ_surplus1095_alt <- readRDS(".data/surplus1095coefs_surplus1095_invlog_fecy_alt.rds") %>%
mutate(controls = str_replace_all(controls, "surpl5", "surplus1095")) %>%
mutate(coef = "econ",
type_control = "wosub")
#### Reading models without subsistence controls
econ_surplus1095_alt <- readRDS("./data/surplus1095coefs_surplus1095_invlog_fecy_alt.rds") %>%
mutate(controls = str_replace_all(controls, "surpl5", "surplus1095")) %>%
mutate(coef = "econ",
type_control = "wosub")
#setwd("~replication files")
setwd("~/Dropbox/GeopoliticalCompetitionPaper2/Manuscript/ISQ_submission_Jan2019/final_nov2019/replication")
master <- readRDS("./data/master_geopolcompetition2_191101.rds")
# you can choose to load all neccesary data files using this load statement (which takes a while),
# or individually load data files as needed, using the provided readRDS() statements
load("./data/sdp_master.RData")
#setwd("~replication files")
setwd("~/Dropbox/GeopoliticalCompetitionPaper2/Manuscript/ISQ_submission_Jan2019/final_nov2019/replication")
# you can choose to load all neccesary data files using this load statement (which takes a while),
# or individually load data files as needed, using the provided readRDS() statements
load("./data/sdp_master.RData")
